package com.foo.common.base.utils;

import java.io.File;
import java.util.Collection;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.junit.Test;

public class FooTest {

	public static File myFile = new File("C:\\Users/Steve/Desktop/itms.sql");

	@Test
	public void myTest() throws Exception {

		System.out.println(myFile.getPath());
		System.out.println(myFile.getAbsolutePath());

		IOFileFilter filter = new WildcardFileFilter("itms*.sql");

		Collection<File> t = FileUtils.listFiles(new File(
				"C:\\Users/Steve/Desktop/"), filter, null);

		for (File file : t) {
			System.out.println(file.getName());
		}

	}
}
